package com.zc.study.designPattern.行为型设计模式.StrategyPattern;

import sun.util.resources.cldr.tr.CurrencyNames_tr;

public class Test {
    public static void main(String[] args) {
        MovieTickit mt = new MovieTickit();
        double originalPrice = 60.0;
        double currentPrice;

        mt.setPrice(originalPrice);
        System.out.println("原始价为:"+originalPrice);
        System.out.println("--------------");

        Discount discount;
        discount = new StudentDiscount();
        mt.setDiscount(discount); //注入折扣对象

        currentPrice = mt.getPrice();
        System.out.println("折后价为:"+currentPrice);
    }
}
